package com.scs.application.modules.report.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.DataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 报表配置
 * </p>
 */
@Data
@Accessors(chain = true)
@EntityClassAnnotation(remark = "报表配置表")
@TableName("report_config")
public class Config extends DataEntity {

    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "图表键名",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String code;

    @EntityFieldAnnotation(
            text = "图表名称",
            length = "50",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String name;

    @EntityFieldAnnotation(
            text = "图表类型",
            type = EntityFieldType.STRING,
            length = "20",
            not_null = false,
            default_value = "",
            comment = "line：折线图；bar：柱状图、pie：饼图、grid：数据表格。字典值：report_config_types。多选"
    )
    private String type;

    @EntityFieldAnnotation(
            text = "数据来源",
            length = "10",
            not_null = true,
            default_value = "",
            comment = " json、sql、url。 字典值：report_config_source"
    )
    private String source;

    @EntityFieldAnnotation(
            text = "数据JSON",
            type = EntityFieldType.TEXT,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String dataJson;

    @EntityFieldAnnotation(
            text = "数据SQL",
            type = EntityFieldType.TEXT,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String dataSql;

    @EntityFieldAnnotation(
            text = "前置条件",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private JSONArray preConditions;

    @EntityFieldAnnotation(
            text = "数据URL",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String dataUrl;

    @EntityFieldAnnotation(
            text = "显示图表",
            length = "",
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Boolean flagShowChart;

    @EntityFieldAnnotation(
            text = "显示网格",
            length = "",
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Boolean flagShowGrid;

    @EntityFieldAnnotation(
            text = "显示合计",
            length = "1",
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Boolean flagShowSummary;

    @EntityFieldAnnotation(
            text = "启用分页",
            length = "",
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Boolean flagPaging;


    // creator ,在父类中处理


    // gmt_create ,在父类中处理


    // modifier ,在父类中处理


    // gmt_modified ,在父类中处理

    @EntityFieldAnnotation(
            text = "备注",
            length = "255",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String remarks;

    @EntityFieldAnnotation(
            text = "是否看板",
            length = "255",
            not_null = true,
            default_value = "0",
            comment = ""
    )
    private Boolean flagBoard;

    @EntityFieldAnnotation(
            text = "滚动周期",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "滚动周期"
    )
    private String rollCycle;

    @EntityFieldAnnotation(
            text = "刷新周期",
            length = "255",
            not_null = false,
            default_value = "",
            comment = "刷新周期"
    )
    private String refreshCycle;

    @EntityFieldAnnotation(
            text = "前置处理方法",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "前置处理方法"
    )
    private String preFun;

    @EntityFieldAnnotation(
            text = "后置点击方法",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "后置点击方法"
    )
    private String afterFun;


    @EntityFieldAnnotation(
            text = "样式处理方法",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "样式处理方法"
    )
    private String getClassFun;


    @EntityFieldAnnotation(
            text = "扩展按钮获取",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "样式处理方法"
    )
    private String getBtnFun;


    @EntityFieldAnnotation(
            text = "扩展按钮点击",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "扩展按钮点击"
    )
    private String afterBtnFun;

    @EntityFieldAnnotation(
            text = "子标题",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String subtitle;

    @EntityFieldAnnotation(
            text = "是动态列",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagDynamicColumn;

    @EntityFieldAnnotation(
            text = "列sql",
            type = EntityFieldType.TEXT,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String columnSql;
    @EntityFieldAnnotation(
            text = "前置处理方法",
            length = "200",
            not_null = false,
            default_value = "",
            comment = "前置处理方法"
    )
    private String preFunColumnSql;
    @EntityFieldAnnotation(
            text = "不打印序号列",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean noPrintSeq;

    @EntityFieldAnnotation(
            text = "使用临时表",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagTmptable;

    @EntityFieldAnnotation(
            text = "主键索引字段",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "主键索引字段"
    )
    private String tmptableFieldPks;

    @EntityFieldAnnotation(
            text = "唯一索引字段",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "唯一索引字段"
    )
    private String tmptableFieldUnqs;

    @EntityFieldAnnotation(
            text = "普通索引字段",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "普通索引字段"
    )
    private String tmptableFieldIndexs;


    @EntityFieldAnnotation(
            text = "最大字段",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "最大字段"
    )
    private String tmptableFieldMax;

    @EntityFieldAnnotation(
            text = "临时表数据源",
            type = EntityFieldType.TEXT,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String tmptableSql;
    @EntityFieldAnnotation(
            text = "显示临时表清空按钮",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagTmptableClear;

    @EntityFieldAnnotation(
            text = "更新打印相关字段",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagPrint;

    @EntityFieldAnnotation(
            text = "是否通过定时任务校验数据",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagCheckData;

    @EntityFieldAnnotation(
            text = "是否显示复选框",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Boolean flagCheckbox;

    @EntityFieldAnnotation(
            text = "打印及导出底部签名",
            length = "500",
            not_null = false,
            default_value = "",
            comment = "打印及导出底部签名"
    )
    private String footSign;
    @EntityFieldAnnotation(
            text = "二级表头sql",
            type = EntityFieldType.TEXT,
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String columnSql2;


    @EntityFieldAnnotation(
            text = "二级表头显示合计列",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "1:显示每个一级表头的最右边一个二级表头合计列"
    )
    private Boolean flagColumnSum;

    @EntityFieldAnnotation(
            text = "不显示顶部合计",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "1:列表、打印、导出不显示顶部的合计列"
    )
    private Boolean flagTopSum;

    @EntityFieldAnnotation(
            text = "不显示底部合计",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "1:列表、打印、导出不显示底部的合计列"
    )
    private Boolean flagBottomSum;

    @EntityFieldAnnotation(
            text = "不显示右侧合计",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "1:列表、打印、导出不显示最右侧的合计列"
    )
    private Boolean flagRightSum;


    @EntityFieldAnnotation(
            text = "是否固定列二级表头",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "勾选后，展现固定列二级表头"
    )
    private Boolean flagFixedColumn;

    @EntityFieldAnnotation(
            text = "隐藏空列",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "勾选后，如果某一列全是空的那么将不隐藏该字段"
    )
    private Boolean flagHideNull;
}
